/*     */ package com.Ticker.elements;
/*     */ 
/*     */ import java.awt.Color;

import net.ledticker.elements.ArrowToken;
import net.ledticker.elements.DefaultColorModel;
import net.ledticker.elements.Token;

import com.Ticker.tokens.NumberToken;
import com.Ticker.tokens.TextToken;
/*     */ 
/*     */ public class StockTickerElement extends AbstractTickerElement
/*     */ {
/*     */   private TextToken symbol;
/*     */   private NumberToken last;
/*     */   private ArrowToken arrow;
/*     */   private NumberToken changePercent;
/*     */   private StockColorModel stockColorModel;
/*     */ 
/*     */   public StockTickerElement(String stock)
/*     */   {
/*  30 */     super(new Token[4]);
/*     */ 
/*  32 */     this.symbol = new TextToken(stock, new DefaultColorModel(new Color(16777215)));
/*  33 */     this.stockColorModel = new StockColorModel();
/*  34 */     this.last = new NumberToken(this.stockColorModel);
/*  35 */     this.arrow = new ArrowToken(this.stockColorModel);
/*  36 */     this.changePercent = new NumberToken(this.stockColorModel);
/*     */ 
/*  38 */     this.tokens[0] = this.symbol;
/*  39 */     this.tokens[1] = this.last;
/*  40 */     this.tokens[2] = this.arrow;
/*  41 */     this.tokens[3] = this.changePercent;
/*     */   }
/*     */ 
/*     */   public void setLast(Double lastValue)
/*     */   {
/*  50 */     this.last.setValue(lastValue);
/*     */   }
/*     */ 
/*     */   public void setChangePercent(Double change)
/*     */   {
/*  59 */     this.changePercent.setValue(change);
/*  60 */     this.stockColorModel.setChangePercent(change.doubleValue());
/*  61 */     if (change.doubleValue() > 0.0D)
/*  62 */       this.arrow.setValue(ArrowToken.INCREASING);
/*  63 */     else if (change.doubleValue() < 0.0D)
/*  64 */       this.arrow.setValue(ArrowToken.DECREASING);
/*     */     else
/*  66 */       this.arrow.setValue(ArrowToken.UNCHANGED);
/*     */   }
/*     */ 
/*     */   public String getSymbol()
/*     */   {
/*  75 */     return this.symbol.getDisplayValue();
/*     */   }
/*     */ 
/*     */   public void setStockUpColor(Color c)
/*     */   {
/*  83 */     this.stockColorModel.setUpColor(c);
/*     */   }
/*     */ 
/*     */   public void setStockNeutralColor(Color c)
/*     */   {
/*  91 */     this.stockColorModel.setNeutralColor(c);
/*     */   }
/*     */ 
/*     */   public void setStockDownColor(Color c)
/*     */   {
/*  99 */     this.stockColorModel.setDownColor(c);
/*     */   }
/*     */ 
/*     */   public void setSymbolColor(Color c)
/*     */   {
/* 107 */     this.symbol.getColorModel().setColor(c);
/*     */   }
/*     */ }

/* Location:           C:\Users\os\Downloads\TrimOnline.jar
 * Qualified Name:     Ticker.elements.StockTickerElement
 * JD-Core Version:    0.5.4
 */